import TabsView from '@/layouts/tabs/TabsView'
import BlankView from '@/layouts/BlankView'
import PageView from '@/layouts/PageView'
import pageView from "@/layouts/PageView";

// 路由配置
const options = {
  routes: [
    {
      path: '/login',
      name: '登录页',
      component: () => import('@/pages/login')
    },
    {
      path: '*',
      name: '404',
      component: () => import('@/pages/exception/404'),
    },
    {
      path: '/403',
      name: '403',
      component: () => import('@/pages/exception/403'),
    },
    {
      path: '/',
      name: '首页',
      component: TabsView,
      redirect: '/login',
      children: [
        {
          path: 'dashboard',
          name: 'Dashboard',
          meta: {
            icon: 'dashboard'
          },
          component: BlankView,
          children: [
            {
              path: 'workplace',
              name: '工作台',
              meta: {
                page: {
                  closable: false
                }
              },
              component: () => import('@/pages/dashboard/workplace'),
            },
          ]
        },
        {
          path: 'farm',
          name: '园区管理',
          redirect: '/farm/index',
          component: PageView,
          meta: {title: '园区管理', icon: 'environment'},
          children: [
            {
              path: '/farm/index',
              name: '园区信息',
              component: () => import('@/pages/farm/Index')
            },
            {
              path: '/farm/manager',
              name: '管理员信息',
              component: () => import('@/pages/farm/Manager')
            }
          ]
        },
        {
          path: 'land',
          name: '地块管理',
          component: () => import('@/pages/land/Index'),
          meta: { icon: 'compass'}
        },
        {
          path: 'plant',
          name: '种植信息',
          redirect: '/plant/produce',
          component: pageView,
          meta: {title: '种植信息', icon: 'contacts'},
          children: [
            {
              path: '/plant/produce',
              name: '种植作物',
              component: () => import('@/pages/plant/Produce')
            }
          ]
        },
        {
          path: '/dev',
          name: '物联设备',
          redirect: '/dev/index',
          component: PageView,
          meta: { title: '物联设备', icon: 'control'},
          children: [
            {
              path: '/dev/index',
              name: '设备信息',
              component: () => import('@/pages/dev/Index')
            },{
              path: '/dev/controller',
              name: '设备控制',
              component: () => import('@/pages/dev/Controller')
            },{
              path: '/dev/setup',
              name: '设备设置',
              meta: {
                invisible: true
              },
              component: () => import('@/pages/dev/SetUp')
            }
          ]
        },
        {
          path: '/trace',
          redirect: '/trace/index',
          name: '溯源管理',
          component: PageView,
          meta: { title: '溯源管理', icon: 'project'},
          children: [
            {
              path: '/trace/index',
              name: '溯源信息',
              component: () => import('@/pages/trace/Index'),
            },{
              path: '/trace/add',
              name: '新建溯源',
              component: () => import('@/pages/trace/Add'),
            },{
              path: '/trace/options',
              name: '操作信息',
              component: () => import('@/pages/trace/Options'),
            },{
              path: '/trace/check',
              name: '检测信息',
              component: () => import('@/pages/trace/Check')
            }
          ]
        },
        {
          path: '/alarm',
          redirect: '/alarm/options',
          name: '预警管理',
          component: PageView,
          meta: { title: '预警管理', icon: 'heat-map'},
          children: [
            {
              path: '/alarm/index',
              name: '预警信息',
              component: () => import('@/pages/alarm/Index')
            }, {
              path: '/alarm/options',
              name: '预警设置',
              component: () => import('@/pages/alarm/Options'),
            }
          ]
        },
        {
          path: '/visual',
          redirect: '/visual/info',
          name: '组态管理',
          component: PageView,
          meta: { title: '组态管理', icon: 'desktop'},
          children: [
            {
              path: '/visual/info',
              name: '组态信息',
              component: () => import('@/pages/visual/Info')
            }, {
              path: '/visual/display',
              name: '设备组态配置',
              component: () => import('@/pages/visual/Index')
            }, {
              path: '/visual/independent',
              name: '园区组态配置',
              component: () => import('@/pages/visual/Independent'),
            }
          ]
        },
        {
          path: '/largeScreen',
          redirect: '/largeScreen/info',
          name: '大屏管理',
          component: PageView,
          meta: { title: '大屏管理', icon: 'desktop'},
          children: [
            {
              path: '/largeScreen/info',
              name: '大屏信息',
              component: () => import('@/pages/largeScreen/Info')
            }, {
              path: '/largeScreen/disposition',
              name: '大屏配置',
              component: () => import('@/pages/largeScreen/Disposition')
            }
          ]
        },
        {
          path: '/device',
          redirect: '/device/sensor',
          name: '设备管理',
          component: PageView,
          meta: { title: '设备管理', icon: 'control'},
          children: [
            {
              path: '/device/sensor',
              name: '传感器配置',
              component: () => import('@/pages/device/sensor')
            }, {
              path: '/device/led',
              name: 'LED配置',
              component: () => import('@/pages/device/led')
            }
          ]
        },
          // page start
        // {
        //   path: 'form',
        //   name: '表单页',
        //   meta: {
        //     icon: 'form',
        //     page: {
        //       cacheAble: false
        //     }
        //   },
        //   component: PageView,
        //   children: [
        //     {
        //       path: 'basic',
        //       name: '基础表单',
        //       component: () => import('@/pages/form/basic'),
        //     },
        //     {
        //       path: 'step',
        //       name: '分步表单',
        //       component: () => import('@/pages/form/step'),
        //     },
        //     {
        //       path: 'advance',
        //       name: '高级表单',
        //       component: () => import('@/pages/form/advance'),
        //     }
        //   ]
        // },
        // {
        //   path: 'list',
        //   name: '列表页',
        //   meta: {
        //     icon: 'table'
        //   },
        //   component: PageView,
        //   children: [
        //     {
        //       path: 'query',
        //       name: '查询表格',
        //       meta: {
        //         authority: 'queryForm',
        //       },
        //       component: () => import('@/pages/list/QueryList'),
        //     },
        //     {
        //       path: 'query/detail/:id',
        //       name: '查询详情',
        //       meta: {
        //         highlight: '/list/query',
        //         invisible: true
        //       },
        //       component: () => import('@/pages/Demo')
        //     },
        //     {
        //       path: 'primary',
        //       name: '标准列表',
        //       component: () => import('@/pages/list/StandardList'),
        //     },
        //     {
        //       path: 'card',
        //       name: '卡片列表',
        //       component: () => import('@/pages/list/CardList'),
        //     },
        //     {
        //       path: 'search',
        //       name: '搜索列表',
        //       component: () => import('@/pages/list/search/SearchLayout'),
        //       children: [
        //         {
        //           path: 'article',
        //           name: '文章',
        //           component: () => import('@/pages/list/search/ArticleList'),
        //         },
        //         {
        //           path: 'application',
        //           name: '应用',
        //           component: () => import('@/pages/list/search/ApplicationList'),
        //         },
        //         {
        //           path: 'project',
        //           name: '项目',
        //           component: () => import('@/pages/list/search/ProjectList'),
        //         }
        //       ]
        //     }
        //   ]
        // },
        // {
        //   path: 'details',
        //   name: '详情页',
        //   meta: {
        //     icon: 'profile'
        //   },
        //   component: BlankView,
        //   children: [
        //     {
        //       path: 'basic',
        //       name: '基础详情页',
        //       component: () => import('@/pages/detail/BasicDetail')
        //     },
        //     {
        //       path: 'advance',
        //       name: '高级详情页',
        //       component: () => import('@/pages/detail/AdvancedDetail')
        //     }
        //   ]
        // },
        // {
        //   path: 'result',
        //   name: '结果页',
        //   meta: {
        //     icon: 'check-circle-o',
        //   },
        //   component: PageView,
        //   children: [
        //     {
        //       path: 'success',
        //       name: '成功',
        //       component: () => import('@/pages/result/Success')
        //     },
        //     {
        //       path: 'error',
        //       name: '失败',
        //       component: () => import('@/pages/result/Error')
        //     }
        //   ]
        // },
        // {
        //   path: 'exception',
        //   name: '异常页',
        //   meta: {
        //     icon: 'warning',
        //   },
        //   component: BlankView,
        //   children: [
        //     {
        //       path: '404',
        //       name: 'Exp404',
        //       component: () => import('@/pages/exception/404')
        //     },
        //     {
        //       path: '403',
        //       name: 'Exp403',
        //       component: () => import('@/pages/exception/403')
        //     },
        //     {
        //       path: '500',
        //       name: 'Exp500',
        //       component: () => import('@/pages/exception/500')
        //     }
        //   ]
        // },
        // {
        //   path: 'components',
        //   name: '内置组件',
        //   meta: {
        //     icon: 'appstore-o'
        //   },
        //   component: PageView,
        //   children: [
        //     {
        //       path: 'taskCard',
        //       name: '任务卡片',
        //       component: () => import('@/pages/components/TaskCard')
        //     },
        //     {
        //       path: 'palette',
        //       name: '颜色复选框',
        //       component: () => import('@/pages/components/Palette')
        //     },
        //     {
        //       path: 'table',
        //       name: '高级表格',
        //       component: () => import('@/pages/components/table')
        //     }
        //   ]
        // },
        // {
        //   name: '验权表单',
        //   path: 'auth/form',
        //   meta: {
        //     icon: 'file-excel',
        //     authority: {
        //       permission: 'form'
        //     }
        //   },
        //   component: () => import('@/pages/form/basic')
        // },
        // {
        //   name: '带参菜单',
        //   path: 'router/query',
        //   meta: {
        //     icon: 'project',
        //     query: {
        //       name: '菜单默认参数'
        //     }
        //   },
        //   component: () => import('@/pages/Demo')
        // },
        // {
        //   name: '动态路由菜单',
        //   path: 'router/dynamic/:id',
        //   meta: {
        //     icon: 'project',
        //     params: {
        //       id: 123
        //     }
        //   },
        //   component: () => import('@/pages/Demo')
        // },
        // {
        //   name: 'Ant Design Vue',
        //   path: 'antdv',
        //   meta: {
        //     icon: 'ant-design',
        //     link: 'https://www.antdv.com/docs/vue/introduce-cn/'
        //   }
        // },
        // page end
        {
          name: '接口文档',
          path: 'document',
          meta: {
            icon: 'file-word',
            link: 'http://47.105.122.163:10051/swagger/index.html/#/'
          }
        }

      ]
    },
  ]
}

export default options
